package com.linkoog.devtools.code_generator.template.model.node;

import com.linkoog.devtools.code_generator.template.model.NodeData;

import java.io.Serializable;



public class FileNodeData extends NodeData implements Serializable {

    private static final long serialVersionUID = -329690965910519848L;

    public FileNodeData(){}

    public FileNodeData(String name, String type) {
        this.name = name;
        this.type = type;
    }

    // 文件类型
    private String type;

    // 描述
    private String description = "";

    //模版内容
    private String template = "";

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    @Override
    public FileNodeData copy() {
        FileNodeData fileNodeData = new FileNodeData();
        fileNodeData.setName(this.getName());
        fileNodeData.setType(this.getType());
        fileNodeData.setTemplate(this.getTemplate());
        fileNodeData.setDescription(this.getDescription());
        return fileNodeData;
    }

    @Override
    public FileNodeData deepCopy() {
        return copy();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        FileNodeData that = (FileNodeData) o;

        if (name != null ? !name.equals(that.name) : that.name != null) {
            return false;
        }
        if (type != null ? !type.equals(that.type) : that.type != null) {
            return false;
        }
        if (description != null ? !description.equals(that.description) : that.description != null) {
            return false;
        }
        if (template != null ? !template.equals(that.template) : that.template != null) {
            return false;
        }

        return true;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("FileNodeData{");
        sb.append("description='").append(description).append('\'');
        sb.append(", template='").append(template).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
